package cn.xu.bookstore.order.domain;

import java.util.Date;
import java.util.List;

import cn.xu.bookstore.user.domain.User;

public class Order {
	private String oid;
	private Date ordertime;//下单的时间
	private Double total;//合计
	//订单的状态 1未付款给 2已付款未发货 3已发货但为确认收货  4已确认收货交易成功
	private Integer state;
	private User owner;//订单所有者
	private String address;
	private List<OrderItem> orderItems;//这个订单下的所有条目
	public Order() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Order(String oid, Date ordertime, Double total, Integer state,
			User owner, String address, List<OrderItem> orderItems) {
		super();
		this.oid = oid;
		this.ordertime = ordertime;
		this.total = total;
		this.state = state;
		this.owner = owner;
		this.address = address;
		this.orderItems = orderItems;
	}
	public String getOid() {
		return oid;
	}
	public void setOid(String oid) {
		this.oid = oid;
	}
	public Date getOrdertime() {
		return ordertime;
	}
	public void setOrdertime(Date ordertime) {
		this.ordertime = ordertime;
	}
	public Double getTotal() {
		return total;
	}
	public void setTotal(Double total) {
		this.total = total;
	}
	public Integer getState() {
		return state;
	}
	public void setState(Integer state) {
		this.state = state;
	}
	public User getOwner() {
		return owner;
	}
	public void setOwner(User owner) {
		this.owner = owner;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public List<OrderItem> getOrderItems() {
		return orderItems;
	}
	public void setOrderItems(List<OrderItem> orderItems) {
		this.orderItems = orderItems;
	}
	@Override
	public String toString() {
		return "Order [oid=" + oid + ", ordertime=" + ordertime + ", total="
				+ total + ", state=" + state + ", owner=" + owner
				+ ", address=" + address + ", orderItems=" + orderItems + "]";
	}
	
	
	

}
